﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;

namespace Ken_WPF_UI.View
{
    /// <summary>
    /// ExpanderWindow.xaml 的交互逻辑
    /// </summary>
    public partial class ExpanderWindow : Window
    {
        public ExpanderWindow()
        {
            InitializeComponent();
        }

        /// <summary>
        /// 折叠方向控制
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void DirectBtn_Click(object sender, RoutedEventArgs e)
        {
            if (sender is Button)
            {
                string direct = (sender as Button).Tag.ToString();
                switch (direct)
                {
                    case "Top":
                        this.expander1.ExpandDirection = ExpandDirection.Up;
                        break;  
                    case "Left":
                        this.expander1.ExpandDirection = ExpandDirection.Left;
                        break;
                    case "Right":
                        this.expander1.ExpandDirection = ExpandDirection.Right;
                        break;
                    case "Down":
                        this.expander1.ExpandDirection = ExpandDirection.Down;
                        break;
                    default:
                        this.expander1.ExpandDirection = ExpandDirection.Down;
                        break;
                }
                
            }
        }
    }
}
